﻿using MiniFox.Infrastructure;
using MiniFox.Infrastructure.Attributes;
using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace MiniFox.Platform.File.Models
{
    /// <summary>
    /// 
    /// </summary>
    [JsonObject, TreeNode("FolderId", "SuperId", "Ordinal", "Group")]
    public class FolderObject
    {
        /// <summary>
        /// 
        /// </summary>
        [Key]
        [JsonProperty("folderId")]
        public string FolderId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonIgnore]
        public string SuperId { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("folderName")]
        public string FolderName { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("createTime"), JsonConverter(typeof(DateTimeJsonConverter), GlobalStandardFormat.SIMPLE_DATETIME_FORMAT)]
        public DateTime CreateTime { get; set; }
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("updateTime"), JsonConverter(typeof(DateTimeJsonConverter), GlobalStandardFormat.SIMPLE_DATETIME_FORMAT)]
        public DateTime UpdateTime { get; set; }
        /// <summary>
        /// 排序值
        /// </summary>
        [JsonProperty("ordinal")]
        public int Ordinal { get; set; }
        /// <summary>
        /// 全路径
        /// </summary>
        [JsonProperty("path")]
        public string Path { get; set; } = string.Empty;
        /// <summary>
        /// 
        /// </summary>
        [JsonProperty("group")]
        public string Group { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public IEnumerable<FileData> Files { get; set; }
    }
}
